using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// ѡ���ɫ
/// </summary>

public class UIRolePickForm : MonoBehaviour
{
    [SerializeField]
    private Dropdown rolePickDropdown;
    [SerializeField]
    private Button gameBeginButton;

    private int pickId = 0;

    void Start()
    {
        rolePickDropdown.onValueChanged.AddListener(x =>
        {
            int.TryParse(rolePickDropdown.options[x].text, out var pickPlayerId);
            pickId = pickPlayerId;
         //   ClientRunningEvent.RolePick(pickPlayerId);
        });

        gameBeginButton.onClick.AddListener(() =>
        {
            // if (pickId == 0)
            // {
            //     ClientRunningEvent.RolePick(101);
            //     ClientRunningEvent.SyncBegin();
            // }
            // else
            // {
            //     ClientRunningEvent.SyncBegin();
            // }
            // gameObject.SetActive(false);
            //
            // if (FrameOperateSync.HelperUtility.SinglePlayerMode)
            // {
            //     FrameOperateSync.NetworkUtility.MarkPlayerReady();
            // }
        });
    }
}

